home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4654 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  60 lines

  1. Path: wariat.org!!dhall
  2. From: dhall@ (d. hall)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ASCII value of a character
  5. Date: 6 Feb 1996 00:38:57 GMT
  6. Organization: APK - Internet Provider for Ohio.
  7. Message-ID: <4f67v1$piu@wariat.wariat.org>
  8. References: <Pine.SUN.3.91.960202222737.26868B-100000@parsifal.nando.net>
  9.     <Pine.A32.3.91.960204214621.123007E-100000@red.weeg.uiowa.edu>
  10. NNTP-Posting-Host: mentor-dial-1.apk.net
  11. Gcc: nnfolder:folder.archive 
  12.  
  13. -----BEGIN PGP SIGNED MESSAGE-----
  14.  
  15. ≡ thus on Sun, 4 Feb 1996 21:50:13 -0600, james virtually scripted...
  16.  
  17. On Fri, 2 Feb 1996, pretzel wrote:
  18.  
  19. >> How do you find the ascii value of a character?  What I am actually
  20. >> trying to do is read a tab from the keyboard and use it in a switch
  21. >> statement.  If the user hits tab, input a certain variable, etc.  Also,
  22. >> finding ascii values has infinite other uses.
  23.  
  24. james> printf("The character code for TAB is %d\n", '\t');
  25.  
  26. if you're using...
  27.  
  28. int input;
  29.  
  30. input = getchar ();    /* in RAW mode */
  31.  
  32. switch (input)
  33.   {
  34.   case '\t':
  35.   /* source for processing TAB */
  36.      break;
  37.   }
  38.  
  39. It makes the source a little more readable instead of using the ASCII
  40. numbers for the different designates.  Just a matter of style.
  41.  
  42. d.
  43. - --
  44. Grok:
  45.   [from the novel "Stranger in a Strange Land", by R. A. Heinlein,
  46.   where it is a Martian word meaning roughly "to be one with"] v. To
  47.   understand, usually in a global sense.
  48.                 ~ from the jargon file
  49.  
  50. -----BEGIN PGP SIGNATURE-----
  51. Version: 2.6.2
  52. Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
  53.  
  54. iQCVAwUBMRai4IX26urqpgG1AQHHIwQArXModueNOygUivo2oADk6pohTBYfn0uc
  55. oc6WMGvrmNO6LmYIQgc6L0w2SluPytvvEXzR84dRvBxBF3DZFCUpiU+ZsVNRuwnB
  56. qs0xiLcN9+/ahhs8dLQtxB2FMtPmejxfrl+iWYDjBesZdU7wCS2hcQhPmE2785hv
  57. cizGo2qtYBw=
  58. =GDRm
  59. -----END PGP SIGNATURE-----
  60.